using System;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace X.Ray.Core.Framework.Crypto
{
    /// <summary>
    /// Author:              Joe Audette
    /// Created:            2/6/2006
    /// Last Modified:    2/6/2006
    /// </summary>
    public class mojoEncryptionConfiguration
    {

        private XmlNode rsaNode;

        public void LoadValuesFromConfigurationXml(XmlNode node)
        {

            foreach (XmlNode child in node.ChildNodes)
            {
                if (child.Name == "RSAKeyValue")
                    rsaNode = child;
            }
        }

        public String RSAKey
        {
            get
            {
                if (this.rsaNode != null)
                    return this.rsaNode.OuterXml;

                return String.Empty;

            }

        }

        public static mojoEncryptionConfiguration GetConfig()
        {
            return (mojoEncryptionConfiguration)ConfigurationManager.GetSection("system.web/mojoEncryption");
        }


    }
}
